/**
 * 
 */
package cn.wangsy.zhidao.p20170328;

/**
 * @author wangsy
 * @date 2017年3月28日下午3:10:17
 */
public class Hero {

	private int hp = 100;
	
	public int getHp() {
		return hp;
	}

	public void setHp(int hp) {
		this.hp = hp;
	}

	public void hit(Hero other){
		other.decrease();
	}
	
	private void decrease(){
		this.hp = this.hp - 1;
	}
	
	public void displayHp(){
		System.out.println("当前英雄血量："+hp);
	}
	
	public static void main(String[]args){
		Hero hero1 = new Hero();
		Hero hero2 = new Hero();
		
		hero1.hit(hero2);
		hero2.displayHp();
	}
	
}
